import {createStore} from 'vuex'
import layout from "@/common/store/layout";
import user from "@/common/store/user";
import router from "@/common/store/router";
import setting from "@/common/store/setting";

//_store 实例
const _store = createStore({
    state() {
        return {
            ...layout.state,
            ...user.state,
            ...router.state,
            ...setting.state,
        }
    }
})

export default _store;
//
// 使用方式
//
//import $store from "@/common/store/_store";
//
//{
// data() {
//     return {
//         title: $store.state.adminName,
//     }
// }
//
// mounted() {
//
//     this.$watch(() => $store.state.adminName, () => {
//       // //console.log($store.state.adminName)
//     })
//
//     $store.state.adminName='11111'
//
// }
//}
